package socket

import (
	"time"

	"qmp_go_push/pkg/response"
	"qmp_go_push/pkg/socket"
)

func Ping(requestParam *socket.Packet) response.Response {
	// 参数校验
	//checkParam := request.Validate(requestParam.Param, map[string]any{
	//	"exec": "required",
	//})
	//if !checkParam {
	//	return response.ResponseParamMiss()
	//}
	// 参数封装
	// service调用
	requestParam.Client.SetHeartbeat(uint64(time.Now().Unix()))
	// 结构化数据返回
	return response.Response{
		Status:  response.Success.Code,
		Message: response.Success.Message.Error(),
		TraceId: "",
		Data:    "pong",
	}
}
